<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>登录</title>

<link href="../js/bootstrap-3.3.5/css/bootstrap.min.css" rel="stylesheet">
<style type="text/css">
body{
background-color:#5cb89f;
}
body{
 font-family: 'microsoft yahei',Arial,sans-serif;
 margin:0;
 padding:0;
}
.modal{
top:18%;;
}
</style>
    
<script type="text/javascript" src="../js/jquery/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="../js/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<%String path=request.getContextPath();%>
<script type="text/javascript">
$(function(){
	$("#login_in").click(function(){
		alert("login_in");
		var account=$("#account").val();
		var password=$("#password").val();
		if(password==null||password==""){
			alert("密码不能为空！");
			return;
		}else if(account==null||account==""){
			alert("帐号不能为空！");
			return;
		}
		loginForm();
	})
});
function loginForm(){
	//alert("进入loginForm");
	$.post(
		"loginCheck",
		{
		account:$("#account").val(),
		password:$("#password").val()
			},
		function(rm){
			//alert(rm.status+"***"+rm.message);
			if(rm.status==0){
				//alert("帐号和密码错误，请重试！");
				return;
			}else if(rm.status==1){
				window.location.href="${path}/admin/index";
				//alert("登录成功！");
			}
		},"json");
}
</script>
</head>
<body>
<%-- 	<h1>登录,一定要美</h1>
	<div class="container">
	<div id="loginForm" >
		<table>
			<tr>
				<td>帐号：</td>
				<td>
				<input type="text" id="account" name="account" value="${sysUser.account }"/>
				</td>
			</tr>
			<tr>
				<td>密码：</td>
				<td><input type="text" id="password" name="password" value="${sysUser.password }"/></td>
			</tr>
			<button id="login_in" type="submit" class="btn btn-primary"><strong>提交</strong></button>
			
		</table>
	</div>
	</div> --%>

<div id="loginModal" class="modal show">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close">x</button>
        <h1 class="text-center text-primary">登录</h1>
      </div>
      <div class="modal-body">
        <div class="col-md-12 center-block">
          <div class="form-group">
            <input type="text"  id="account" name="account" value="${sysUser.account }" class="form-control input-lg" placeholder="登录账户">
          </div>
          <div class="form-group">
            <input type="password" id="password" name="password" value="${sysUser.password }" class="form-control input-lg" placeholder="登录密码">
          </div>
          <div class="form-group">
            <button id="login_in" class="btn btn-primary btn-lg btn-block">立刻登录</button>
            <span><a href="#">找回密码</a></span>
            <span><a href="#" class="pull-right">注册</a></span>
          </div>
        </div>
      </div>
      <div class="modal-footer">
        
      </div>
    </div>
  </div>
</div>
</body>
</html>